package com.asw.springboot.common.listener;

import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.context.ApplicationListener;

/**
 * Created by hxq on 2017/5/18.
 */
public class MyApplicationFailedEventListener implements ApplicationListener<ApplicationFailedEvent> {
    @Override
    public void onApplicationEvent(ApplicationFailedEvent event) {
        String errorMsg = event.getException().getMessage();
        System.out.println("如果启动时存在异常时被发送"+errorMsg);
    }
}
